package com.sumainfor.pc.market.service;

import com.sumainfor.common.util.ContextUtils;
import com.sumainfor.common.utlis.ParamsCommon;
import com.sumainfor.pc.market.dao.RdHousingDoubtMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Date 2018年11月7日
 * @Describe 房源存在疑问
 */
@Service
public class RdHousingDoubtService implements Serializable {

    private ReentrantLock lock = new ReentrantLock(false);

    Logger log = LoggerFactory.getLogger(RdHousingDoubtService.class);// 日志

    @Autowired
    private RdHousingDoubtMapper rdHousingDoubtMapper;
    /**
     * 新增房源存在的疑问
     * @param params
     * @return
     */
    public Integer addHousingDoubt(Map<String, Object> params){
        Integer result = 0;
        try {
            params.put("by", ContextUtils.getUserId());//操作人
            params.put("SysUserId", ContextUtils.getUserId());// 发起人编号
            params.put("term", "2");// 创建端 Insert端： 1 租客端 2市场部 3 工程部   4运营部   5财务部  6总经办 7发展部
            params.put("fnc",
                    this.getClass().getSimpleName() + "." + Thread.currentThread().getStackTrace()[1].getMethodName());// 创建Function名
            ParamsCommon.commonInsertParms(params);
            result = rdHousingDoubtMapper.addHousingDoubt(params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
